﻿using System;
using Commands.Settings;

namespace Commands.TorrentDownloaders
{
    internal class RuTrackerDownloadDispatcher : TokenDispatcherBase, ITokenDispatcher
    {
        public RuTrackerDownloadDispatcher(ServiceSettings settings)
            : base(settings)
        {

        }

        protected override Uri DispatcherLoginPage
        {
            get
            {
                return new Uri(@"http://login.rutracker.org/forum/login.php");
            }
        }

        protected override string DOWNLOAD_LINK_REGEXP
        {
            get
            {
                                           //http://dl.rutracker.org/forum/dl.php?t=3976890"
                return "\"(?<download_link>http\\://dl\\.rutracker\\.org/forum/dl\\.php\\?t=\\d\\d+)\"";
                                              return "\"(?<download_link>download\\.php\\?id=\\d\\d+)\"";

            }
        }

        protected override string CHECK_TRACKER_REGEXP
        {
            get
            {
                return @"http\://rutracker\.org/forum/viewtopic\.php\?t=\d+";
            }
        }
    }
}
